<?php
/***************************************************************************
*                            Dolphin Smart Community Builder
*                              -------------------
*     begin                : Mon Mar 23 2006
*     copyright            : (C) 2007 BoonEx Notice
*     website              : http://www.boonex.com
* This file is part of Dolphin - Smart Community Builder
*
* Dolphin is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the
* License, or  any later version.
*
* Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
* You should have received a copy of the GNU General Public License along with Dolphin,
* see license.txt file; if not, write to marketing@boonex.com
***************************************************************************/

bx_import ('BxDolTwigCalendar');

class BxNoticesCalendarAvailable extends BxDolTwigCalendar {

    function BxNoticesCalendarAvailable ($iYear, $iMonth, &$oDb, &$oTemplate, &$oConfig) {
        parent::BxDolTwigCalendar($iYear, $iMonth, $oDb, $oConfig);
    }

    function getEntriesNames () {
        return array(_t('_modzzz_notices_notice_single'), _t('_modzzz_notices_notice_plural'));
    }

    function _getWeekNames () {
        if(0 == $this->iWeekStart)
            $aWeek[] = array('name' => _t('_modzzz_notices_week_sun'));
        $aWeek[] = array('name' => _t('_modzzz_notices_week_mon'));
        $aWeek[] = array('name' => _t('_modzzz_notices_week_tue'));
        $aWeek[] = array('name' => _t('_modzzz_notices_week_wed'));
        $aWeek[] = array('name' => _t('_modzzz_notices_week_thu'));
        $aWeek[] = array('name' => _t('_modzzz_notices_week_fri'));
        $aWeek[] = array('name' => _t('_modzzz_notices_week_sat'));
        if(8 == $this->iWeekEnd)
            $aWeek[] = array('name' => _t('_modzzz_notices_week_sun'));
        return $aWeek;        
    } 

    /**
     * return base calendar url
     * year and month will be added to this url automatically
     * so if your base url is /m/some_module/calendar/, it will be transormed to
     * /m/some_module/calendar/YEAR/MONTH, like /m/some_module/calendar/2009/3
     */  
    function getBaseUri () {
        return BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . "calendar_available/";
    }

    function getBrowseUri () {
        return BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . "browse/calendar_available/";
    }

    function getData () {
        return $this->oDb->getAvailableEntriesByMonth ($this->iYear, $this->iMonth, $this->iNextYear, $this->iNextMonth);
    }


}

?>